package com.lnu.information.gui;

import javax.swing.*;
import java.awt.*;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 2:20 PM 2022/5/19
 * @modified By :
 */
public class AbsolutePosition extends JFrame {

    public AbsolutePosition() throws HeadlessException {
        this.setTitle("本窗口使用绝对布局");
        this.setLayout(null);
        this.setBounds(150,200,300,150);
        Container c = getContentPane();
        JButton b1 = new JButton("按钮1");
        JButton b2 = new JButton("按钮2");
        JButton b3 = new JButton("按钮3");
        b1.setBounds(10,30,80,30);
        b2.setBounds(10,70,80,30);
        b3.setBounds(100,30,80,30);
        c.add(b1);
        c.add(b2);
        c.add(b3);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new AbsolutePosition();
    }
}
